//
//  CCFoundation_SwiftTests.swift
//  CCFoundation_SwiftTests
//
//  Created by zjh on 2021/10/15.
//

import XCTest
import CCFoundation_Swift

class person {
    var name: String?
    init() {
        self.name = "我还没改名"
    }
}
class CCFoundation_SwiftTests: XCTestCase {
    var delay: CCDelay?
    var timer: Timer?
    
    override func setUpWithError() throws {
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }
    
    override func tearDownWithError() throws {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
    }
    
    func testExample() throws {
        DispatchQueue.global().async {
            
            self.delay = CCDelay.init(target: self, sel: #selector(self.printAction), afterDelay: 5)
            self.delay?.start()
            self.delay?.end()
            
            self.delay = CCDelay.init(target: self, sel: #selector(self.printAction), afterDelay: 5)
            self.delay?.start()
            self.delay?.end()

            self.delay = CCDelay.init(target: self, sel: #selector(self.printAction), afterDelay: 5)
            self.delay?.start()
            self.delay = nil
        }
        Thread.sleep(forTimeInterval: 60)
        // This is an example of a functional test case.
        // Use XCTAssert and related functions to verify your tests produce the correct results.
    }
    
    @objc func printAction() {
        debugPrint("定时触发")
        
    }
    
    func testPerformanceExample() throws {
        // This is an example of a performance test case.
        self.measure {
            // Put the code you want to measure the time of here.
        }
    }
    
}
